package net.jjjshop.front.controller.commom;

import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import net.jjjshop.common.ali.sms.AliYunSmsUtil;
import net.jjjshop.common.entity.Sms;
import net.jjjshop.common.service.common.SmsService;
import net.jjjshop.framework.common.api.ApiResult;
import net.jjjshop.framework.log.annotation.OperationLog;
import net.jjjshop.front.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Api(value = "common", tags = {"购物车管理"})
@RestController
@RequestMapping("/front/common/sms")
public class SmsController  extends BaseController {

    @Autowired
    private SmsService smsService;

//    @RequestMapping(value = "/sendSms", method = RequestMethod.POST)
    @RequestMapping(value = "/sendSms", method = RequestMethod.POST)
    @OperationLog(name = "sendSms")
    @ApiOperation(value = "sendSms", response = String.class)
    public ApiResult<String> sendSms(@Validated @RequestBody Sms sendSmsVo){
        smsService.sendCommonCode(sendSmsVo);
        return ApiResult.ok("result");
    }


}
